import NProgress from 'nprogress'
import { setPageTitle } from '@/utils'

export function beforeGuard(router: Router) {
  router.beforeEach((to) => {
    NProgress.start()
    setPageTitle(to.meta.title as string)
  })
}

export function afterGuard(router: Router) {
  router.afterEach(() => {
    NProgress.done()
  })
}
